package com.hxd.otc.module.order.bean;

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.hxd.otc.utils.StringUtil;

import java.io.Serializable;
import java.util.List;

/**
 * 作  者 :  zjl
 * 时  间 :  2018/6/5 18:04
 * 描  述 :  ${TODO}
 */
public class AllOrderBean implements Serializable {


    public List<DataBean> list;

    public static class DataBean implements Serializable, Parcelable {


        public String id;//订单id ,
        @NonNull
        public String subOrderId;//订单号
        public String createBy;
        public String updateBy;
        public long createDate;
        public long updateDate;
        public String orderId; //广告id
        public String orderUserId; //广告id

        public String supportCurrencyCode;//广告接受法币币种,多个以逗号隔开
        public String symbol;//虚拟币
        public String publishSource;//发布渠道，eg1:plat;eg2:otc
        public double volume;//实际成交数量
        public double orderVolume;//成交数量
        public String feeVolume;//广告手续费
        public String coinId;//币种ID

        public double price;//价格
        public double totalPrice;// 实际成交总价
        public double orderTotalPrice;//订单总价
        public String userMobile; //手机号
        public String userId;
        public String exType;//订单类型 0：买入 1：卖出
        //        public int type;//0.卖出,1.买入【广告商订单买卖相反：0.买入,1.卖出】
        public String askUserMobile;//被交易方手机号
        public String askUserId;//被交易用户id
        public String remarks; //买卖备注
        public int status;//0:买入下单|卖出下单;1:确认付款了,9:取消,2:确认收到款,3:确认没收到款
        //        public int status;//0.未支付，1，已付款，2.申诉中，3.已取消，4.完成 ,
        public String radomNum; //备注号
        public String confirmReceiptDate;//确认收到款时间
        public String confirmPaymentDate;//确认付款时间
        public String cancelDate;//取消订单时间
        public long remainingTime; //剩余秒数
        public String realName; //实际名称
        public String askRealName; //实际名称
        public String askNickName; //实际名称
        public String userFeeVolume; ////商户手续费
        public String rebateFee; //利润返点
        public String rebateStatus; //返利状态，0待返，1成功，2失败，3处理中

        private String confirmPaymentName;// 付款账号名称
        private String confirmPaymentAccount;//付款账号信息
        public String partStatus;//部分确认状态：0不支持确认收款，1支持部分确认收款
        public int fixQrcode;//（0无须上传.1已上传.2待上传）
        public long qrCodeTimeOut;//（超时秒数）

        public void setRemainingTime(long remainingTime) {
            this.remainingTime = remainingTime;
        }

        public int getFixQrcode() {
            return fixQrcode;
        }

        public void setFixQrcode(int fixQrcode) {
            this.fixQrcode = fixQrcode;
        }

        public long getQrCodeTimeOut() {
            return qrCodeTimeOut;
        }

        public void setQrCodeTimeOut(long qrCodeTimeOut) {
            this.qrCodeTimeOut = qrCodeTimeOut;
        }

        public double getOrderVolume() {
            return orderVolume;
        }

        public void setOrderVolume(double orderVolume) {
            this.orderVolume = orderVolume;
        }

        public double getOrderTotalPrice() {
            return orderTotalPrice;
        }

        public void setOrderTotalPrice(double orderTotalPrice) {
            this.orderTotalPrice = orderTotalPrice;
        }

        public String getRebateStatus() {
            return rebateStatus;
        }

        public void setRebateStatus(String rebateStatus) {
            this.rebateStatus = rebateStatus;
        }

        public String getAskNickName() {
            if (TextUtils.isEmpty(askNickName)) {
                askNickName = askRealName;
            }
            return StringUtil.emptyIfNull(askNickName);
        }

        public String getPartStatus() {
            return partStatus;
        }

        public void setPartStatus(String partStatus) {
            this.partStatus = partStatus;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getSubOrderId() {
            return subOrderId;
        }

        public void setSubOrderId(String subOrderId) {
            this.subOrderId = subOrderId;
        }

        public String getCreateBy() {
            return createBy;
        }

        public void setCreateBy(String createBy) {
            this.createBy = createBy;
        }

        public String getUpdateBy() {
            return updateBy;
        }

        public void setUpdateBy(String updateBy) {
            this.updateBy = updateBy;
        }

        public long getCreateDate() {
            return createDate;
        }

        public void setCreateDate(long createDate) {
            this.createDate = createDate;
        }

        public long getUpdateDate() {
            return updateDate;
        }

        public void setUpdateDate(long updateDate) {
            this.updateDate = updateDate;
        }

        public String getOrderId() {
            return orderId;
        }

        public void setOrderId(String orderId) {
            this.orderId = orderId;
        }

        public String getOrderUserId() {
            return orderUserId;
        }

        public void setOrderUserId(String orderUserId) {
            this.orderUserId = orderUserId;
        }

        public String getSupportCurrencyCode() {
            return supportCurrencyCode;
        }

        public void setSupportCurrencyCode(String supportCurrencyCode) {
            this.supportCurrencyCode = supportCurrencyCode;
        }

        public String getSymbol() {
            return symbol;
        }

        public void setSymbol(String symbol) {
            this.symbol = symbol;
        }

        public String getPublishSource() {
            return publishSource;
        }

        public void setPublishSource(String publishSource) {
            this.publishSource = publishSource;
        }

        public double getVolume() {
            return volume;
        }

        public void setVolume(double volume) {
            this.volume = volume;
        }

        public String getFeeVolume() {
            return feeVolume;
        }

        public void setFeeVolume(String feeVolume) {
            this.feeVolume = feeVolume;
        }

        public String getCoinId() {
            return coinId;
        }

        public void setCoinId(String coinId) {
            this.coinId = coinId;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public double getTotalPrice() {
            return totalPrice;
        }

        public void setTotalPrice(double totalPrice) {
            this.totalPrice = totalPrice;
        }

        public String getUserMobile() {
            return userMobile;
        }

        public void setUserMobile(String userMobile) {
            this.userMobile = userMobile;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getExType() {
            return exType;
        }

        public void setExType(String exType) {
            this.exType = exType;
        }

        public String getAskUserMobile() {
            return askUserMobile;
        }

        public void setAskUserMobile(String askUserMobile) {
            this.askUserMobile = askUserMobile;
        }

        public String getAskUserId() {
            return askUserId;
        }

        public void setAskUserId(String askUserId) {
            this.askUserId = askUserId;
        }

        public String getRemarks() {
            return remarks;
        }

        public void setRemarks(String remarks) {
            this.remarks = remarks;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getRadomNum() {
            return radomNum;
        }

        public void setRadomNum(String radomNum) {
            this.radomNum = radomNum;
        }

        public String getConfirmReceiptDate() {
            return confirmReceiptDate;
        }

        public void setConfirmReceiptDate(String confirmReceiptDate) {
            this.confirmReceiptDate = confirmReceiptDate;
        }

        public String getConfirmPaymentDate() {
            return confirmPaymentDate;
        }

        public void setConfirmPaymentDate(String confirmPaymentDate) {
            this.confirmPaymentDate = confirmPaymentDate;
        }

        public String getCancelDate() {
            return cancelDate;
        }

        public void setCancelDate(String cancelDate) {
            this.cancelDate = cancelDate;
        }

        public long getRemainingTime() {
            return remainingTime;
        }

        public void setRemainingTime(int remainingTime) {
            this.remainingTime = remainingTime;
        }

        public String getRealName() {
            return realName;
        }

        public void setRealName(String realName) {
            this.realName = realName;
        }

        public String getAskRealName() {
            return askRealName;
        }

        public void setAskRealName(String askRealName) {
            this.askRealName = askRealName;
        }

        public void setAskNickName(String askNickName) {
            this.askNickName = askNickName;
        }

        public String getConfirmPaymentName() {
            return confirmPaymentName;
        }

        public void setConfirmPaymentName(String confirmPaymentName) {
            this.confirmPaymentName = confirmPaymentName;
        }

        public String getConfirmPaymentAccount() {
            return confirmPaymentAccount;
        }

        public void setConfirmPaymentAccount(String confirmPaymentAccount) {
            this.confirmPaymentAccount = confirmPaymentAccount;
        }

        public String getRebateFee() {
            return rebateFee;
        }

        public void setRebateFee(String rebateFee) {
            this.rebateFee = rebateFee;
        }

        public String getUserFeeVolume() {
            return userFeeVolume;
        }

        public void setUserFeeVolume(String userFeeVolume) {
            this.userFeeVolume = userFeeVolume;
        }

        public boolean isNosenseOrder() {
            if (publishSource.equals("otc-easypay")) {
                return true;
            }
            return false;
        }

        @Override
        public String toString() {
            return "DataBean{" +
                    "id='" + id + '\'' +
                    ", subOrderId='" + subOrderId + '\'' +
                    ", createBy='" + createBy + '\'' +
                    ", updateBy='" + updateBy + '\'' +
                    ", createDate=" + createDate +
                    ", updateDate=" + updateDate +
                    ", orderId='" + orderId + '\'' +
                    ", orderUserId='" + orderUserId + '\'' +
                    ", supportCurrencyCode='" + supportCurrencyCode + '\'' +
                    ", symbol='" + symbol + '\'' +
                    ", publishSource='" + publishSource + '\'' +
                    ", volume=" + volume +
                    ", orderVolume=" + orderVolume +
                    ", feeVolume='" + feeVolume + '\'' +
                    ", coinId='" + coinId + '\'' +
                    ", price=" + price +
                    ", totalPrice=" + totalPrice +
                    ", orderTotalPrice=" + orderTotalPrice +
                    ", userMobile='" + userMobile + '\'' +
                    ", userId='" + userId + '\'' +
                    ", exType=" + exType +
                    ", askUserMobile='" + askUserMobile + '\'' +
                    ", askUserId='" + askUserId + '\'' +
                    ", remarks='" + remarks + '\'' +
                    ", status=" + status +
                    ", radomNum='" + radomNum + '\'' +
                    ", confirmReceiptDate='" + confirmReceiptDate + '\'' +
                    ", confirmPaymentDate='" + confirmPaymentDate + '\'' +
                    ", cancelDate='" + cancelDate + '\'' +
                    ", remainingTime=" + remainingTime +
                    ", realName='" + realName + '\'' +
                    ", askRealName='" + askRealName + '\'' +
                    ", askNickName='" + askNickName + '\'' +
                    ", userFeeVolume='" + userFeeVolume + '\'' +
                    ", rebateFee='" + rebateFee + '\'' +
                    ", rebateStatus=" + rebateStatus +
                    ", confirmPaymentName='" + confirmPaymentName + '\'' +
                    ", confirmPaymentAccount='" + confirmPaymentAccount + '\'' +
                    ", partStatus=" + partStatus +
                    '}';
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.subOrderId);
            dest.writeString(this.createBy);
            dest.writeString(this.updateBy);
            dest.writeLong(this.createDate);
            dest.writeLong(this.updateDate);
            dest.writeString(this.orderId);
            dest.writeString(this.orderUserId);
            dest.writeString(this.supportCurrencyCode);
            dest.writeString(this.symbol);
            dest.writeString(this.publishSource);
            dest.writeDouble(this.volume);
            dest.writeDouble(this.orderVolume);
            dest.writeString(this.feeVolume);
            dest.writeString(this.coinId);
            dest.writeDouble(this.price);
            dest.writeDouble(this.totalPrice);
            dest.writeDouble(this.orderTotalPrice);
            dest.writeString(this.userMobile);
            dest.writeString(this.userId);
            dest.writeString(this.exType);
            dest.writeString(this.askUserMobile);
            dest.writeString(this.askUserId);
            dest.writeString(this.remarks);
            dest.writeInt(this.status);
            dest.writeString(this.radomNum);
            dest.writeString(this.confirmReceiptDate);
            dest.writeString(this.confirmPaymentDate);
            dest.writeString(this.cancelDate);
            dest.writeLong(this.remainingTime);
            dest.writeString(this.realName);
            dest.writeString(this.askRealName);
            dest.writeString(this.askNickName);
            dest.writeString(this.confirmPaymentName);
            dest.writeString(this.confirmPaymentAccount);
            dest.writeString(this.userFeeVolume);
            dest.writeString(this.rebateFee);
            dest.writeString(this.rebateStatus);
            dest.writeString(this.partStatus);
            dest.writeInt(this.fixQrcode);
            dest.writeLong(this.qrCodeTimeOut);
        }

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            this.id = in.readString();
            this.subOrderId = in.readString();
            this.createBy = in.readString();
            this.updateBy = in.readString();
            this.createDate = in.readLong();
            this.updateDate = in.readLong();
            this.orderId = in.readString();
            this.orderUserId = in.readString();
            this.supportCurrencyCode = in.readString();
            this.symbol = in.readString();
            this.publishSource = in.readString();
            this.volume = in.readDouble();
            this.orderVolume = in.readDouble();
            this.feeVolume = in.readString();
            this.coinId = in.readString();
            this.price = in.readDouble();
            this.totalPrice = in.readDouble();
            this.orderTotalPrice = in.readDouble();
            this.userMobile = in.readString();
            this.userId = in.readString();
            this.exType = in.readString();
            this.askUserMobile = in.readString();
            this.askUserId = in.readString();
            this.remarks = in.readString();
            this.status = in.readInt();
            this.radomNum = in.readString();
            this.confirmReceiptDate = in.readString();
            this.confirmPaymentDate = in.readString();
            this.cancelDate = in.readString();
            this.remainingTime = in.readLong();
            this.realName = in.readString();
            this.askRealName = in.readString();
            this.askNickName = in.readString();
            this.confirmPaymentName = in.readString();
            this.confirmPaymentAccount = in.readString();
            this.userFeeVolume = in.readString();
            this.rebateFee = in.readString();
            this.rebateStatus = in.readString();
            this.partStatus = in.readString();
            this.fixQrcode = in.readInt();
            this.qrCodeTimeOut = in.readLong();
        }

        public static final Parcelable.Creator<DataBean> CREATOR = new Parcelable.Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };


    }

    @Override
    public String toString() {
        return "AllOrderBean{" +
                "list=" + list +
                '}';
    }
}
